package com.aaa.controller;

import com.aaa.entity.Orderdetails;
import com.aaa.service.OrderdetailsService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Orderdetails)表控制层
 *
 * @author makejava
 * @since 2022-01-12 13:27:05
 */
@RestController
@RequestMapping("orderdetails")
public class OrderdetailsController {
    /**
     * 服务对象
     */
    @Resource
    private OrderdetailsService orderdetailsService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Orderdetails selectOne(Integer id) {
        return this.orderdetailsService.queryById(id);
    }

//    查看订单详情表
    @RequestMapping("selectOrderdetails")
    public List<Orderdetails> selectOrderdetails(Integer pageNum,Integer pageSize){
        List<Orderdetails> OrderdetailsList=orderdetailsService.queryAllByLimit(pageNum,pageSize);
        return OrderdetailsList;
    }
}